package admin

import (
	"wonlicsys/api/v1/admin"
	"wonlicsys/middleware"
	"wonlicsys/router/handle"
	"github.com/gin-gonic/gin"
)

func AdminUserNoAuth(g *gin.RouterGroup) *gin.RouterGroup {
	AdminUserGroup := g.Group("/adminUser")
	{
		handle.Handle(AdminUserGroup, []string{"POST"}, "/login", admin.Login)
		handle.Handle(AdminUserGroup, []string{"GET"}, "/test", admin.Test)
	}

	return AdminUserGroup
}

func AdminUser(g *gin.RouterGroup) *gin.RouterGroup {

	AdminUserGroup := g.Group("/adminUser")
	{
		AdminUserGroup.Use(middleware.JWTAuthMiddleware())
		handle.Handle(AdminUserGroup, []string{"GET"}, "/info", admin.Info)
	}
	return AdminUserGroup
}